<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@include file="/common/header.jsp"%>
<html>
<head>
    <script type="text/javascript" src="${pageContext.request.contextPath}/script/fusionCharts/JSClass/FusionCharts.js"></script>
    <script type="text/javascript">
        $(function(){
            queryTransactionForm();
          	//加载业务名称数据
            $('#service_uuid').combobox({
                url:"../serviceParam/getAllService.do",
                valueField:'SERVICE_UUID',
                textField:'SERVICE_NAME',
                editable:false,
                onChange:function(record){
                    var value = $('#service_uuid').combobox('getValue');
                    loadServiceParamsInf(value);
                }
            });
            $("#service_param_uuid").combobox({
                onShowPanel : function () {
                    if($("input[name='service_uuid']").val() == '' || $("input[name='service_uuid']").prev().val() == ''){
                        $.jpmessage.warning("请先选择业务名称！");
                        $(this).combo('hidePanel', true);
                    }
                }
            });
        });
        function  queryTransactionForm() {
            var options ={
                url: '<c:url value="/transaction/transactionLogList.do"/>',
                type:'post',
                success:function(resData){
                    var jsonText = resData.xmlData;
                    var transactionColumn2D =
                        new FusionCharts(baseUrl+"/script/fusionCharts/Charts/Column2D.swf", "transactionColumn2D", "1000", "450");
                    transactionColumn2D.setDataXML(jsonText);
                    transactionColumn2D.render("transactionColumn2D");
                    //折线图
                    var transactionLine =
                        new FusionCharts(baseUrl+"/script/fusionCharts/Charts/Line.swf", "transactionLine", "1000", "450");
                    transactionLine.setDataXML(jsonText);
                    transactionLine.render("transactionLine");
                }
            };
            $("#transaction").ajaxSubmit(options);
        }
        /**
         *点击业务的时候载入业务参数数据
         */
        function loadServiceParamsInf(value) {
            $('#service_param_uuid').combobox('clear');
            $('#service_param_uuid').combobox('reload', '../serviceParam/getAllServiceParams.do?service_uuid=' + value)
        }
    </script>
</head>
<body>
<form id="transaction" name="transaction"  method="post">
    <!-- 查询表单 -->
    <div  class="datagrid-toolbar" border="false"  >
            <span>开始日期:</span>
            <input type="text" id="loc_dt_start" name="loc_dt_start" class="easyui-datebox" data-options="editable:false" value="${lastMonth}"/>
            <span>结束日期:</span>
            <input type="text" id="loc_dt_end" name="loc_dt_end" class="easyui-datebox" data-options="editable:false" value="${currentDate}"/>
            <span>机构号:</span>
            <input id="ins_cd" type="text" name="ins_cd"  class="easyui-textbox"  >
            <span>机构名称:</span>
            <input id="ins_cn_nm" type="text" name="ins_cn_nm"  class="easyui-textbox"  ><br>
            <span>业务名称:</span>
            <input class="easyui-combobox" type="text" name="service_uuid" id="service_uuid"  >
            <span>业务参数名称:</span>
            <input class="easyui-combobox" type="text" name="service_param_uuid" id="service_param_uuid" data-options="valueField:'SERVICE_PARAM_UUID', textField:'PARAM_NAME',editable:false," >
            <a href="javascript:void(0)" iconCls="icon-search" class="easyui-linkbutton btn" onclick="queryTransactionForm()">查询</a>
            <a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetForm() ">重置</a>
    </div>
    <jiepos:buttonOperateTag menuCode="${menuCode}"></jiepos:buttonOperateTag>
</form>
<div id="transactionColumn2D" align="center"></div>
<div id="transactionLine" align="center"></div>
  </body>
<%@include file="/common/chartHeader.jsp"%>
</html>